﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 用户角色
	/// </summary>
	[Serializable]
	[Table("Sys_UserRole")]
	public partial class Sys_UserRole
	{
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 用户ID
		/// </summary>
		[Column("UserID")]
		public int UserID { get; set; }

		/// <summary>
		/// 角色ID
		/// </summary>
		[Column("RoleID")]
		public int RoleID { get; set; }

		/// <summary>
		/// 授权是否有效
		/// </summary>
		[Column("AuthValid")]
		public bool AuthValid { get; set; }

		/// <summary>
		/// 授权过期时间
		/// </summary>
		[Column("AuthExpireDate")]
		public DateTime? AuthExpireDate { get; set; }

		/// <summary>
		/// 排序（值越小排序越靠前）
		/// </summary>
		[Column("Sort")]
		public int Sort { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }
	}
}
